/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.util.time;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 *
 * @author lariverosc
 */
public class TimeUtil {

    private static long ini;

    /**
     * 
     */
    public static void init() {
        ini = System.currentTimeMillis();
    }

    /**
     * 
     * @return
     */
    public static long timeInMiliSeconds() {
        return System.currentTimeMillis() - ini;
    }

    /**
     * 
     * @return
     */
    public static double timeInSeconds() {
        return (double) timeInMiliSeconds() / 1000;
    }

    /**
     * 
     * @return
     */
    public static double timeInMinuts() {
        return timeInSeconds() / 60;
    }
    private static final String DATE_FORMAT_NOW = "yyyy_MM_dd-HH.mm.ss";

    public static String getCurrentDate() {
        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
        return sdf.format(cal.getTime());
    }
}
